package com.example.mapper;

import com.example.bean.Admin;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


import java.util.List;

public interface AdminMapper{
    @Select("SELECT adminId,adminName,adminPhone,adminPassword,adminImg FROM admin WHERE adminId=#{adminId}")
    public Admin selectAdminById(String adminId);
    @Select("SELECT adminId,adminName,adminPhone,adminPassword,adminImg FROM admin")
    public List<Admin> selectAdminAll();
    @Insert("INSERT Into admin(adminId,adminName,adminPhone,adminPassword,adminImg) VALUES(#{adminId},#{adminName},#{adminPhone},#{adminPassword},#{adminImg})")
    public int insertAdmin(Admin admin);
    @Delete("DELETE FROM admin WHERE adminId=#{adminId}")
    public int deleteAdmin(String adminId);
    @Update("UPDATE admin SET adminName=#{adminName},adminPhone=#{adminPhone},adminPassword=#{adminPassword},adminImg=#{adminImg} where adminId=#{adminId}")
    public int updateAdmin(Admin admin);

}
